<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>宝宅智能家居-网关登录</title>

    <meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">

    <link href="css/vendor/bootstrap.min.css" rel="stylesheet">
    <link href="css/flat-ui.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
      <script src="js/jquery.min.js"></script>
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
      <script src="js/vendor/html5shiv.js"></script>
      <script src="js/vendor/respond.min.js"></script>

    <![endif]-->

      <script >
          $(document).ready( function(){

              $("#login").click( function() {
                  var pass = $("#login-pass").val();
                  $.getJSON("/api/mdpasswd?passwd=" + pass,function(data){
                     if ( data.result=="fail" ){
                         $("#login-pass").focus();
                        alert("修改失败!");
                     }else{
                         alert("修改成功!");
                     }
                  });
              });


              document.onkeydown = function(e){
                  var ev = document.all ? window.event : e;
                  if(ev.keyCode==13) {
                      $("#login").click();
                  }
              };

              $("#login-pass").focus();

          });
      </script>
  </head>
  <body style="background-color: #1ABC9C;">
          <div class="login">
              <div class="login-icon">
                <img src="img/logo.png" />
              </div>

              <div class="login-form">
                <div class="form-group">
                  <input type="input" class="form-control login-field" value="" placeholder="请输入新密码" id="login-pass" />
                  <label class="login-field-icon fui-lock" for="login-pass"></label>
                </div>
                <a class="btn btn-primary btn-lg btn-block" href="#" id="login">确认</a>
              </div>
          </div>

  

      <footer>宝宅智能家居 bate v0.1</footer>
  </body>
</html>
